/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.sms.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;
import com.chlitina.store.modules.sys.entity.Store;

/**
 * 店面充值短信Entity
 * @author lvbo
 * @version 2013-06-21
 */
@Entity
@Table(name = "store_recharge_sms_log")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StoreRechargeSmsLog extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 店面群发消息编号
	private Store store; 		// 店面
	private Date smsRechargeTime; 	// 短信充值时间
	private Float smsRechargeMoney; // 短信充值金额
	private Integer smsRechargeAmount; // 短信充值数量

	public StoreRechargeSmsLog() {
	}

	public StoreRechargeSmsLog(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_sms_smsStoreGroupLog")
	//@SequenceGenerator(name = "seq_sms_smsStoreGroupLog", sequenceName = "seq_sms_smsStoreGroupLog")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="store_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@Column(name="sms_recharge_time")
	public Date getSmsRechargeTime() {
		return smsRechargeTime;
	}

	public void setSmsRechargeTime(Date smsRechargeTime) {
		this.smsRechargeTime = smsRechargeTime;
	}

	@Column(name="sms_recharge_money")
	public Float getSmsRechargeMoney() {
		return smsRechargeMoney;
	}

	public void setSmsRechargeMoney(Float smsRechargeMoney) {
		this.smsRechargeMoney = smsRechargeMoney;
	}

	@Column(name="sms_recharge_amount")
	public Integer getSmsRechargeAmount() {
		return smsRechargeAmount;
	}

	public void setSmsRechargeAmount(Integer smsRechargeAmount) {
		this.smsRechargeAmount = smsRechargeAmount;
	}
}


